package io;

import java.io.*;

public class ooDemo {
    public static void main(String[] args) throws IOException {
        //需求：将Persaon对象写入文件person.obj中保存
        String name = "王克晶";
        int age = 18;
        String gender = "女";
        String[] otherInfo = {"嗓门大","技术好","黑"};
        Person p = new Person(name, age, gender, otherInfo);
        System.out.println(p);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(p);
        System.out.println("输完完毕");
        oos.close();




    }
}
